/**
 * 
 */
package stc.skymobi.content.transformer;

import java.util.HashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import stc.skymobi.content.Content;
import stc.skymobi.content.Path2ContentTransformer;


/**
 * @author hp
 *
 */
public class DefaultPath2ContentTransformer implements Path2ContentTransformer {

    private static final Logger logger 
    	= LoggerFactory.getLogger(DefaultPath2ContentTransformer.class);
    
    private Map<String, Content>    contents = new HashMap<String, Content>();
    
    public void clearContents() {
        contents.clear();
    }
    
    public void addContent(String path, Content content) {
        contents.put(path, content);
        if ( logger.isDebugEnabled() ) {
	        logger.debug("addContent: " + path + "->" + content );
        }
    }
    
    public Object transform(String path) {
        return contents.get(path);
    }
}
